<!-- View -->
<script type="text/javascript" src="<?php echo $img_url; ?>style/js/FE/forwarding.js"></script>

<div id="detail-title">
    <span class="title"><?php echo $page_title; ?></span>
    <img src="<?php echo $img_url; ?>style/images/img28.gif">
    <div class="ico-social">
        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_url; ?>&display=popup&ref=plugin" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgfb.gif" width="16" height="16" border="0"></a>
        <a href="https://twitter.com/share" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgtw.gif" width="16" height="16" border="0"></a>
        <a href="https://plus.google.com/share?url=<?php echo $current_url; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/imggp.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="return openPopup('contactForm')"><img src="<?php echo $img_url; ?>style/images/imgma.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="javascript:window.print();"><img src="<?php echo $img_url; ?>style/images/imgpr.gif" width="16" height="16" border="0"></a>

        <span class="time">
            <?php
            //show date time Tieng Viet
            $str_search = array(
                "Mon",
                "Tue",
                "Wed",
                "Thu",
                "Fri",
                "Sat",
                "Sun"
            );
            $str_replace = array(
                "Th&#7913; hai",
                "Th&#7913; ba",
                "Th&#7913; t&#432;",
                "Th&#7913; n&#259;m",
                "Th&#7913; s&#225;u",
                "Th&#7913; b&#7843;y",
                "Ch&#7911; nh&#7853;t"
            );
            $timenow = gmdate("D, d/m/Y | H:i", time() + 7 * 3600);
            $timenow = str_replace($str_search, $str_replace, $timenow);
            echo $timenow;
            ?>      
        </span>
    </div>
</div>  
<div id="seperator"></div>
<!-- details: column -->
<div id="detail-body">
    <form method="get" id="formCustoms">
        <input type="text" value="<?php if (isset($_GET["txtSearch"])) echo $_GET["txtSearch"]; ?>" id="txtSearch" name="txtSearch" placeholder="Nhập nội dung cần tìm">
        <input type="text" value="<?php
        if (isset($_GET["cateId"])) {
            foreach ($cate as $value) {
                if ($value->cate_id == $_GET["cateId"]) {
                    echo $value->cate_name;
                    break;
                }
            }
        }
        ?>" id="txtCate" name="txtCate" placeholder="Chọn chuyên mục" onclick="Forwarding.toogleCate();" readonly>
        <img src="<?php echo $img_url; ?>style/img/showmore.png" class="buttonShowMore" onclick="Forwarding.toogleCate();" />
        <input type="button" value="Tìm kiếm" id="btnSearch" onclick="Forwarding.search();" />
        <input type="hidden" id="hidCateId" value="" />
    </form>
    <div class="clearfix"></div>
    </br>
    <div id="customs-body">  
        <?php
        if (sizeof($listArticles) > 0) {
            ?>
            <table id="listCustoms" border="0" cellspacing="1" cellpadding="0" >
                <tr class="tableHeader">
                    <td class="thSTT">STT</td>
                    <td class="thName">Bài viết</td>
                    <td class="thCate">Chuyên mục</td>
                </tr>
                <?php
                foreach ($listArticles as $key => $value):
                    ?>
                    <tr>
                        <td  class="tdSTT"><?php echo $key + ($currentPage - 1) * 10 + 1; ?></td>
                        <td ><a href="/nghiep-vu-giao-nhan/<?php echo $value->url . '-' . $value->id; ?>"><?php echo $value->title; ?></a></td>
                        <td ><?php
                            foreach ($cate as $cate_value) {
                                if ($cate_value->cate_id == $value->cate) {
                                    echo $cate_value->cate_name;
                                    break;
                                }
                            }
                            ?></td>
                    </tr>   
                <?php endforeach ?>
            </table>
            <div id="customs-paging">
            <?php echo $paging; ?>
            </div>
            <?php
        } else {
            ?>
            <div id="nodata">Thông tin đang được cập nhật.</div>
            <?php
        }
        ?>
    </div>
</div>  
<div id="forwarding_cate">
    <?php
    if ($cate != null && sizeof($cate) > 0) {
        $itemPerColumn = round(sizeof($cate) / 2);
        ?>
        <ul class="cate_content">
            <?php for ($i = 0; $i < $itemPerColumn; $i++) { ?>
                <li onclick="Forwarding.selectCate('<?php echo $cate[$i]->cate_id; ?>', '<?php echo $cate[$i]->cate_name; ?>');"><?php echo $cate[$i]->cate_name; ?></li>
            <?php } ?>
        </ul>
        <ul class="cate_content">
            <?php for ($i = $itemPerColumn; $i < sizeof($cate); $i++) { ?>
                <li onclick="Forwarding.selectCate('<?php echo $cate[$i]->cate_id; ?>', '<?php echo $cate[$i]->cate_name; ?>');"><?php echo $cate[$i]->cate_name; ?></li>
        <?php } ?>
        </ul>
<?php } ?>
    <div class="clearfix"></div>
</div>